class RmodelsController < ApplicationController
  # GET /rmodels
  # GET /rmodels.xml
  def index
    @rmodels = Rmodel.find(:all)

    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @rmodels.to_xml }
    end
  end

  # GET /rmodels/1
  # GET /rmodels/1.xml
  def show
    @rmodel = Rmodel.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
      format.xml  { render :xml => @rmodel.to_xml }
    end
  end

  # GET /rmodels/new
  def new
    @rmodel = Rmodel.new
  end

  # GET /rmodels/1;edit
  def edit
    @rmodel = Rmodel.find(params[:id])
  end

  # POST /rmodels
  # POST /rmodels.xml
  def create
    @rmodel = Rmodel.new(params[:rmodel])

    respond_to do |format|
      if @rmodel.save
        flash[:notice] = 'Rmodel was successfully created.'
        format.html { redirect_to rmodel_url(@rmodel) }
        format.xml  { head :created, :location => rmodel_url(@rmodel) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @rmodel.errors.to_xml }
      end
    end
  end

  # PUT /rmodels/1
  # PUT /rmodels/1.xml
  def update
    @rmodel = Rmodel.find(params[:id])

    respond_to do |format|
      if @rmodel.update_attributes(params[:rmodel])
        flash[:notice] = 'Rmodel was successfully updated.'
        format.html { redirect_to rmodel_url(@rmodel) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @rmodel.errors.to_xml }
      end
    end
  end

  # DELETE /rmodels/1
  # DELETE /rmodels/1.xml
  def destroy
    @rmodel = Rmodel.find(params[:id])
    @rmodel.destroy

    respond_to do |format|
      format.html { redirect_to rmodels_url }
      format.xml  { head :ok }
    end
  end
end
